home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / SCSI.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  4.2 KB  |  126 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SCSI.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __SCSI__
  13. #define __SCSI__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19.  
  20. enum {
  21.  
  22.     scInc = 1,
  23.     scNoInc = 2,
  24.     scAdd = 3,
  25.     scMove = 4,
  26.     scLoop = 5,
  27.     scNop = 6,
  28.     scStop = 7,
  29.     scComp = 8,
  30.     scCommErr = 2,                  /*communications error, operation timeout*/
  31.     scArbNBErr = 3,                 /*arbitration timeout waiting for not BSY*/
  32.     scBadParmsErr = 4,              /*bad parameter or TIB opcode*/
  33.     scPhaseErr = 5,                 /*SCSI bus not in correct phase for attempted operation*/
  34.     scCompareErr = 6,               /*data compare error*/
  35.     scMgrBusyErr = 7,               /*SCSI Manager busy */
  36.     scSequenceErr = 8,              /*attempted operation is out of sequence*/
  37.     scBusTOErr = 9,                 /*CPU bus timeout*/
  38.     scComplPhaseErr = 10,           /*SCSI bus wasn't in Status phase*/
  39.     sbSIGWord = 0x4552,
  40.     pMapSIG = 0x504D
  41. };
  42.  
  43. struct Block0 {
  44.     unsigned short sbSig;           /*unique value for SCSI block 0*/
  45.     unsigned short sbBlkSize;       /*block size of device*/
  46.     unsigned long sbBlkCount;       /*number of blocks on device*/
  47.     unsigned short sbDevType;       /*device type*/
  48.     unsigned short sbDevId;         /*device id*/
  49.     unsigned long sbData;           /*not used*/
  50.     unsigned short sbDrvrCount;     /*driver descriptor count*/
  51.     unsigned long ddBlock;          /*1st driver's starting block*/
  52.     unsigned short ddSize;          /*size of 1st driver (512-byte blks)*/
  53.     unsigned short ddType;          /*system type (1 for Mac+)*/
  54.     unsigned short ddPad[243];      /*ARRAY[0..242] OF INTEGER; not used*/
  55. };
  56.  
  57. typedef struct Block0 Block0;
  58.  
  59. struct Partition {
  60.     unsigned short pmSig;           /*unique value for map entry blk*/
  61.     unsigned short pmSigPad;        /*currently unused*/
  62.     unsigned long pmMapBlkCnt;      /*# of blks in partition map*/
  63.     unsigned long pmPyPartStart;    /*physical start blk of partition*/
  64.     unsigned long pmPartBlkCnt;     /*# of blks in this partition*/
  65.     unsigned char pmPartName[32];   /*ASCII partition name*/
  66.     unsigned char pmParType[32];    /*ASCII partition type*/
  67.     unsigned long pmLgDataStart;    /*log. # of partition's 1st data blk*/
  68.     unsigned long pmDataCnt;        /*# of blks in partition's data area*/
  69.     unsigned long pmPartStatus;     /*bit field for partition status*/
  70.     unsigned long pmLgBootStart;    /*log. blk of partition's boot code*/
  71.     unsigned long pmBootSize;       /*number of bytes in boot code*/
  72.     unsigned long pmBootAddr;       /*memory load address of boot code*/
  73.     unsigned long pmBootAddr2;      /*currently unused*/
  74.     unsigned long pmBootEntry;      /*entry point of boot code*/
  75.     unsigned long pmBootEntry2;     /*currently unused*/
  76.     unsigned long pmBootCksum;      /*checksum of boot code*/
  77.     unsigned char pmProcessor[16];  /*ASCII for the processor type*/
  78.     unsigned short pmPad[188];      /*512 bytes long currently unused*/
  79. };
  80.  
  81. typedef struct Partition Partition;
  82.  
  83. struct SCSIInstr {
  84.     unsigned short scOpcode;
  85.     unsigned long scParam1;
  86.     unsigned long scParam2;
  87. };
  88.  
  89. typedef struct SCSIInstr SCSIInstr;
  90.  
  91.  
  92. #ifdef __cplusplus
  93. extern "C" {
  94. #endif
  95. pascal OSErr SCSIReset(void)
  96.     = {0x4267,0xA815}; 
  97. pascal OSErr SCSIGet(void)
  98.     = {0x3F3C,0x0001,0xA815}; 
  99. pascal OSErr SCSISelect(short targetID)
  100.     = {0x3F3C,0x0002,0xA815}; 
  101. pascal OSErr SCSICmd(Ptr buffer,short count)
  102.     = {0x3F3C,0x0003,0xA815}; 
  103. pascal OSErr SCSIRead(Ptr tibPtr)
  104.     = {0x3F3C,0x0005,0xA815}; 
  105. pascal OSErr SCSIRBlind(Ptr tibPtr)
  106.     = {0x3F3C,0x0008,0xA815}; 
  107. pascal OSErr SCSIWrite(Ptr tibPtr)
  108.     = {0x3F3C,0x0006,0xA815}; 
  109. pascal OSErr SCSIWBlind(Ptr tibPtr)
  110.     = {0x3F3C,0x0009,0xA815}; 
  111. pascal OSErr SCSIComplete(short *stat,short *message,unsigned long wait)
  112.     = {0x3F3C,0x0004,0xA815}; 
  113. pascal short SCSIStat(void)
  114.     = {0x3F3C,0x000A,0xA815}; 
  115. pascal OSErr SCSISelAtn(short targetID)
  116.     = {0x3F3C,0x000B,0xA815}; 
  117. pascal OSErr SCSIMsgIn(short *message)
  118.     = {0x3F3C,0x000C,0xA815}; 
  119. pascal OSErr SCSIMsgOut(short message)
  120.     = {0x3F3C,0x000D,0xA815}; 
  121. #ifdef __cplusplus
  122. }
  123. #endif
  124.  
  125. #endif
  126.